package com.freecloud.whispered.auth.controller;

import com.freecloud.whispered.auth.entity.SysUserEntity;
import com.freecloud.whispered.auth.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: maomao
 * @Date: 2019-09-02 18:15
 */
@Api
@RestController
@RequestMapping("/feign/sys/user")
public class SysUserFeignController extends AbstractController {

    @Autowired
    private SysUserService sysUserService;

    @ApiOperation(value = "根据userId获取用户对象", notes = "获取用户，内部服务调用")
    @PostMapping("/queryUserById")
    @ResponseBody
    @RequiresPermissions("system:feign")
    public SysUserEntity queryUserById(@RequestParam("userid") Long userid){
        return sysUserService.queryUserById(userid);
    }
}
